<?php

use Illuminate\Http\Request;


Route::group(['prefix'=>'user'], function() {
    Route::any('usersregist', 'Api\UserController@usersregist');          #注册用户
    Route::any('regist', 'Api\UserController@regist');                    #注册用户
});

# 用户相关路由
Route::group(['prefix'=>'user', 'middleware'=>['api.token']], function() {
    Route::any('userinfo', 'Api\UserController@userinfo');          #注册用户
    Route::any('edituser', 'Api\UserController@edituser');          #修改用户信息
    Route::any('getlike', 'Api\UserController@getlike');            #添加喜好统计
    Route::any('bonuslist', 'Api\UserController@bonusList');            #添加喜好统计
    Route::any('updateuser', 'Api\UserController@updateUser');            #添加喜好统计
});

# 地址相关路由
Route::group(['prefix'=>'address', 'middleware'=>['api.token']], function() {
    Route::any('address', 'Api\AddressController@address');            #地址列表
    Route::any('addaddress', 'Api\AddressController@addaddress');      #添加收货地址
    Route::any('editaddress', 'Api\AddressController@editaddress');    #编辑收货地址
    Route::any('deladdress', 'Api\AddressController@deladdress');      #删除收货地址
});

# 活动相关路由
Route::group(['prefix'=>'activity', 'middleware'=>['api.token']], function() {
    Route::any('activitys', 'Api\ActivityController@activitys');       #活动列表
    Route::any('activityinfo', 'Api\ActivityController@activityinfo'); #活动详情
    Route::any('joinactivity', 'Api\ActivityController@joinactivity'); #统一翻牌接口

});

# 卡券相关接口
Route::group(['prefix'=>'card', 'middleware'=>['api.token']], function() {
    Route::any('cardsign', 'Api\CardController@cardsign');             #获取卡券签名
    Route::any('unsetcard', 'Api\CardController@unsetcard');           #核销卡券
    Route::any('makeqrcode', 'Api\CardController@makeqrcode');         #生成带参数二维吗
    Route::any('saveformid', 'Api\CardController@saveformid');         #收集form_id
    Route::any('getsuccess', 'Api\CardController@getsuccess');     #领取卡券接口
});

# 订单相关接口
Route::group(['prefix'=>'order', 'middleware'=>['api.token']], function() {
    Route::any('orderlist', 'Api\OrderController@orderlist');          #活动订单列表接口
    Route::any('addorder', 'Api\OrderController@addOrder');          #生成订单接口
    Route::any('orderlists', 'Api\OrderController@orderLists');          #订单接口
    Route::any('payorder', 'Api\OrderController@payOrder');          #支付接口
    Route::any('ordernotify', 'Api\OrderController@ordernotify');          #支付接口
    Route::any('checkcardorder', 'Api\OrderController@checkCardOrder');          #验证卡券是否可以领取
    Route::any('del', 'Api\OrderController@del');          #删除订单
    Route::any('getcardlist', 'Api\OrderController@getCardList');          #删除订单

});


# 购物车相关接口
Route::group(['prefix'=>'cart', 'middleware'=>['api.token']], function() {
    Route::any('add', 'Api\CartController@addCart');          #添加购物车
    Route::any('del', 'Api\CartController@del');          #清空购物车
    Route::any('update', 'Api\CartController@update');          #更新购物车
    Route::any('getcart', 'Api\CartController@getCart');
});

# 订单相关接口
Route::group(['prefix'=>'goods', 'middleware'=>['api.token']], function() {
    Route::any('goodsdetail', 'Api\GoodsController@goodsDetail');          #商品详情接口
    Route::any('goodslist', 'Api\GoodsController@goodsList');          #商品列表接口
});

# 订单相关接口
Route::group(['prefix'=>'member', 'middleware'=>['api.token']], function() {
    Route::any('addmember', 'Api\MemberController@addMember');          #添加会员
    Route::any('member', 'Api\MemberController@getMember');          #获取会员信息
    Route::any('getweixinmember', 'Api\MemberController@getWeixinMember');          #获取会员信息
    Route::any('addsign', 'Api\MemberController@addSign');          #添加签到
    Route::any('addsigns', 'Api\MemberController@addSigns');          #添加签到
    Route::any('getsign', 'Api\MemberController@getSign');          #获取签到
    Route::any('getsigns', 'Api\MemberController@getSigns');          #获取签到
});



# 订单相关接口
Route::group(['prefix'=>'notify'], function() {
    Route::any('ordernotify', 'Api\OrderController@ordernotify');          #支付接口
});

# 回收相关接口
Route::group(['prefix'=>'reservation','middleware'=>['api.token']], function() {
    Route::any('add', 'Api\ReservationController@addReservation');          #添加回收记录
    Route::any('getreservationlist', 'Api\ReservationController@getReservationList');          #回收记录列表
    Route::any('editreservationstatus', 'Api\ReservationController@editReservationStatus');          #编辑预约回收状态
    Route::any('getreservationdetail', 'Api\ReservationController@getReservationDetail');          #回收记录详情

});


# 测试类接口
Route::group(['prefix'=>'test'], function() {
    Route::any('sendtemp', 'Api\TestController@sendtemp');          #测试发送模板消息
    Route::any('test', 'Api\TestController@test');
    Route::any('tests', 'Api\TestController@gettest');
    Route::any('send', 'Api\TestController@send');
    Route::any('gettoken', 'Api\TestController@getToken');
    Route::any('getuser', 'Api\UserController@getUser');
});


Route::any('weixin/api', 'Api\WeixinController@api');
